package com.company.meituan2020;

import java.util.Scanner;
import java.util.Stack;

public class Main1{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String input = sc.nextLine();
        String ret = getRes(input);
        System.out.println(ret);

    }

    private static String getRes(String input){
        String[] words = input.split(" ");
        Stack<String> stack = new Stack<>();
        int len = words.length;
        for(int i = 0;i < len;i++){
            String temp = words[i];
            if(temp.equals("true")  || temp.equals( "false")){
                if(stack.isEmpty()){
                    stack.push(temp);
                }else if(stack.peek().equals("true")  || stack.peek().equals("false")  ){
                    return "error";
                }else if(stack.peek().equals("or")) {
                    stack.push(temp);
                }else if(stack.peek().equals( "and") ){
                    stack.pop();
                    if(!stack.isEmpty()){
                        String prefix = stack.peek();
                        stack.pop();
                        stack.push(logisticAnd(prefix,temp) == true ? "true" : "false");
                    }else{
                        return "error";
                    }
                }
            }

            if(temp.equals("or" )|| temp.equals("and")){
                if(stack.isEmpty() || stack.peek().equals("or") || stack.peek().equals("and")){
                    return "error";
                }else if(stack.peek().equals("true") || stack.peek().equals("false")){
                    stack.push(temp);
                }

            }
        }
        if(stack.size() == 1){
            if(stack.peek().equals("true") ){
                return "true";
            }
            if(stack.peek().equals("false") ){
                return "false";
            }
            return "error";
        }
        while(!stack.isEmpty()){

            if(stack.peek().equals("true")){
                return "true";
            }
            stack.pop();
        }
        return "false";

    }

    private static boolean logisticAnd(String a,String b){
        if(a.equals("false") || b.equals( "false")){
            return false;
        }else{
            return true;
        }
    }

    private static boolean logisticOr(String a,String b){
        if(a.equals("false") && b.equals("false")){
            return false;
        }else{
            return true;
        }
    }


}
